<?php

namespace Budget\BudgetBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class PageController extends Controller
{
    public function indexAction()
    {
        return $this->render('BudgetBudgetBundle:Page:index.html.twig');
    }
    
    public function contactAction()
    {
        return $this->render('BudgetBudgetBundle:Page:contact.html.twig');
    }
    
    public function contact_sendAction()
    {
        $request = $this->getRequest()->request->all();
        $this->get('session')->getFlashBag()->set('success', 'Wiadomośc została wysłana. E-mail: '.$request['email'].'. Temat: '.$request['subject'].'. Treść: '.$request['body']);
        return $this->redirect($this->generateUrl('BudgetBudgetBundle_contact')); 
    }
}
